package com.biboheart.demos.random.controller;

import com.biboheart.brick.model.BhResponseResult;
import com.biboheart.demos.random.domain.PersonDomain;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@RequestMapping(value = "random/person")
public class PersonController {
    private final PersonDomain personDomain;

    @RequestMapping(value = "info", method = {RequestMethod.POST, RequestMethod.GET})
    public BhResponseResult<?> info() {
        return BhResponseResult.success(personDomain.generatePersonInfo());
    }
}
